namespace G1.EngineV
{

    using System;
    using System.Collections.Generic;
    using Android.Graphics;

    public class Console
    {

        private List<String> _Buffer;
        private int _BufferSize;

        public Console()
        {
            _Buffer = new List<String>();
            _BufferSize = 5;
        }

        public void WriteLine( String Text )
        {

            lock ( _Buffer )
            {

                if ( _Buffer.Count == 5 )
                {
                    _Buffer.RemoveAt( 0 );
                }

                _Buffer.Add( Text );

            }
        }

        public void Render( Canvas Canvas )
        {

            Paint p = new Paint();

            p.Color = Color.Black;
            p.Alpha = 70;

            Canvas.DrawRect( new Rect( 0, 220, 200, 320 ), p );

            Paint pt = new Paint();

            pt.Color = Color.White;

            lock ( _Buffer )
            {
                for ( int i = 0; i < _Buffer.Count; i++ )
                {
                    Canvas.DrawText( _Buffer[i], 0, 225 + ( 15 * i ), pt );
                }

            }

        }

    }
}